<template>
  <div>
    <div id="top-dv">
        <HomePageTopCon v-for="(obj,index) in topList" :key="index" :list="obj"/>
    </div>
  </div>
</template>

<script>
import HomePageTopCon from './HomePageTopCon.vue'
import axios from 'axios'
axios.defaults.baseURL = "http://localhost:8080"
export default {
    components:{
        HomePageTopCon
    },
    created(){
        this.getList()
    },
    data() {
        return {
            topList:[]
        }
    },
    methods:{
        getList(){
            axios({
                url:"/data/getTopList",
                method:"get"
            }).then((res) =>{
                console.log(res);
                this.topList = res.data
            })
        }
    }
}
</script>

<style>
    #top-dv{
        width: 100%;
        height: 120px;
        display: flex;
        justify-content: space-between;
    }
</style>